Function.prototype.method = function(name,handle){
    !this.prototype[name] && (this.prototype[name] = handle)
    return this;
}

String.method('startWith',function(startStr){
    if(!startStr || !this){return false;}
    return new RegExp("^"+this).test(str);
})

var url = "http:localhost:8081/xxx";

alert(url.startsWith("http"))